package com.itany.corejava.code08_常用类.日期类;

import com.itany.corejava.util.DateUtil;

import java.text.ParseException;
import java.util.Date;

/**
 * @author 石小俊
 * @date 2023年04月28日 9:31
 */
public class Test04_日期工具类 {

    public static void main(String[] args) throws ParseException {
        System.out.println(DateUtil.toString(new Date()));
        System.out.println(DateUtil.toString(new Date(),"yyyy年MM月dd日"));

        System.out.println(DateUtil.toDate("2023-02-03 09:09:09"));
        System.out.println(DateUtil.toDate("2023/02/23","yyyy/MM/dd"));

        Date date = DateUtil.getNextDay(new Date());
        System.out.println(DateUtil.toString(date));
        System.out.println(DateUtil.toString(DateUtil.getNextDay(new Date())));

        Date date1 = DateUtil.toDate("2023-02-03 21:00:00");
        Date date2 = DateUtil.toDate("2023-02-05 11:00:00");

        System.out.println(DateUtil.getDuringDay(date1,date2));

        System.out.println(DateUtil.get(new Date(),1));

    }

}
